<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    function Model(){
        this.m1 = function(){
            return "数据1：hello"
        }
        this.m2 = function(){
            return "数据2：world"
        }
        this.m3 = function(){
            return "数据1：admin"
        }
    }
    function View(){
        this.v1 = function(data){
            console.log(data)
        }
        this.v2 = function(data){
            alert(data)
        }
        this.v3 = function(data){
            document.write(data)
        }
    }
    function Control(){
        const m = new Model();
        const v = new View();

        this.c1 = function(){
            const data = m.m1()
            v.v2(data)
        }
        this.c2 = function(){
            const data = m.m3()
            v.v1(data)
        }
        this.c3 = function(){
            const data = m.m2()
            v.v3(data)
        }
        this.c4 = function(){
            const data = m.m1()
            v.v3(data)
        }
    }


    const c = new Control()
    c.c4();

    
</script>
</html>